<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>土工、无机结合稳定材料</title>
<style type="text/css">
.detect {
	width: 100%;
}

.detect td {
	padding: 0.2em 0px 0.2em 8px;
	width: 50px;
}

.detect th {
	text-align: center;
}

.detect td input[type="text"] {
	width: 55px;
	text-align: center;
}
</style>
<script type="text/javascript"
	src="<c:url value='/ext/ui/jquery-ui-1.8.12.custom.min.js'/>"></script>
<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css"
	rel="stylesheet" />
<script type='text/javascript'
	src='${ctx}/scripts/plugin/jquery.liveSearch.js'></script>
<script type="text/javascript">
	var tr_id = 2;
	$(document)
			.ready(
					function() {
						$("#reportDate").addClass("Wate").bind("click",
								function() {
									WdatePicker({
										skin : 'whyGreen',
										minDate : '1900-10-01',
										dateFmt : 'yyyy-MM-dd'
									});
								});
						$("#checkdate").addClass("Wate").bind("click",
								function() {
									WdatePicker({
										skin : 'whyGreen',
										minDate : '1900-10-01',
										dateFmt : 'yyyy-MM-dd'
									});
								});
						if(${ not empty id}){
							$("#projName").attr("disabled",true);
						}
						$("#add")
								.click(
										function() {
											tr_id++;
											var str = "<tr id='"+tr_id+"'>"
													+ "<td>【<input type='button'value='删除' onclick='del("
													+ tr_id
													+ ")'>】"
													+ "<input size='10' type='text' name='trialwt05s["+ tr_id+ "].name' class='required'></td>"
													+ "<td><input size='8' style='width: 100%' type='text' name='trialwt05s["
													+ tr_id
													+ "].amount' class='required'></td>"
													+ "<td colspan='2'><input size='8' style='width: 100%' type='text' name='trialwt05s["
													+ tr_id
													+ "].address' class='required'></td>"
													+ "<td colspan='2'><input size='5' style='width: 100%' type='text' name='trialwt05s["
													+ tr_id + "].source'></td>"
													+ "</tr>";
											$("#tab").append(str);
										});
						var validator = $("#inputForm").validate({
							event : "blur",
							isTip : true
						});
						$("#submitbtn").click(function() {
							var checkedBox = $("input[name=ord]:checked");
							var siz = checkedBox.size();
							if (siz >= 1) {
								$("#inputForm").submit();
							} else if (siz == 0) {
								alert("请至少勾选一个检验项目！");
							}
						});
						$("#save").click(function(){
							var checkedBox = $("input[name=ord]:checked");
							var siz = checkedBox.size();
							if(siz >= 1){
								$("#inputForm").attr("action","${ctx}/receive/wt05/trialwt05!save1.action");
								$("#inputForm").submit();
							}else if(siz == 0){
								alert("请至少勾选一个检验项目！");
							}
						});
						$("#projName")
								.liveSearch(
										{
											url : '${ctx}/project/relationship!findDimQuery.action?q='
										});
					});
	function del(id) {
		//alert(id);
		$('#' + id).remove();
	}
	function close() {
		$.window.closeAll();
	}
	function deletedesign(url) {
		$.ajax({
			type : "POST",
			url : url,
			success : function(msg) {
				if (msg == "1") {
					alert("删除成功!");
					window.returnValue = true;
					window.close();
				} else {
					alert("删除失败!");
				}
			}
		});
	}
	function setValue(projName, relationId) {
		url = '${ctx}/project/relationship!findByRelation.action?ralationId='
				+ relationId;
		$
				.ajax({
					type : "POST",
					url : url,
					dataType : 'html',
					success : function(msg) {
						relationObj = eval(msg);
						if (relationObj.success) {
							$("#entrustorgid").val(
									relationObj.relationship.entrustorgid);
							$("#witnessorgid").val(
									relationObj.relationship.witnessorgid);
							$("#witnesses").val(
									relationObj.relationship.witnesses);
							$("#wphone").val(relationObj.relationship.wphone);
							$("#operations").val(
									relationObj.relationship.operations);
							$("#ophone").val(relationObj.relationship.ophone);
							$("#checkpeople").val(
									relationObj.relationship.checkpeople);
							$("#checkphone").val(
									relationObj.relationship.checkphone);
						} else {
							alert("没有检索到数据!");
						}
					},
					error : function(msg) {
						alert("系统出错,请联系管理员");
					}
				});

		$("#projName").val(projName);
		$("#relationId").val(relationId);
		$("#jquery-live-search").fadeOut();
	}

	function setProjName(relaId, entrustorgid, witnessorgid, projName,
			witnesses, wphone, operations, ophone, checkpeople, checkphone) {
		$("#relationId").val(relaId);
		$("#entrustorgid").val(entrustorgid);
		$("#witnessorgid").val(witnessorgid);
		$("#projName").val(projName);
		$("#witnesses").val(witnesses);
		$("#wphone").val(wphone);
		$("#operations").val(operations);
		$("#ophone").val(ophone);
		$("#checkpeople").val(checkpeople);
		$("#checkphone").val(checkphone);

	}

	function addOrg() {
		$("#jquery-live-search").hide();
		var url = "${ctx}/project/relationship!input.action";
		mm = showWindow('项目单位添加', url);
		if (mm) {
			if (mm.projName) {
				$("#projName").val(mm.projName);
			}
			if (mm.projId) {
				$("#projId").val(mm.projId);
			}
		}
	}
</script>
</head>
<body>
	<form action="${ctx}/receive/wt05/trialwt05!save.action" method="post"
		id="inputForm" class="yform">
		<input type="hidden" name="id" value="${id }">
		<table>
			<tr>
				<td style="width: 110px">工程名称</td>
				<td colspan="4"><input type="text" id="projName" 
					class="required" value="${relationship.proj.projName }"> <input
					type="hidden" id="relationId" name="relationId"
					value="${relationId}" /></td>
				<td style="width: 100px">委托编号</td>
				<td colspan="2">${entrustNum }<input name="entrustNum" type="hidden" id=""
					value="${entrustNum }"></td>
			</tr>
			<tr>
				<td>委托单位</td>
				<td colspan="4"><input type="text" name="entrustorgid"
					id="entrustorgid" value="${relationship.entrustorgid}" readonly="readonly"></td>
				<td>送检日期</td>
				<td colspan="2"><input type="text" id="checkdate"
					class='required' name="checkdate" value="<fmt:formatDate value="${checkdate }" pattern="yyyy-MM-dd"/> "></td>
			</tr>
			<tr>
				<td>检验类别</td>
				<td colspan="4"><pt:code category="5001" name="checktype"
						default="${ checktype}"></pt:code></td>
				<td>样品处理意见</td>
				<td><input type="radio" name="idea" value="0"
					<c:if test="${idea != 1 }"> checked="checked"</c:if>>不退样</td>
				<td><input type="radio" name="idea" value="1"
					<c:if test="${idea == 1 }"> checked="checked"</c:if>>退样</td>
			</tr>
			<tr>
				<td>见证单位</td>
				<td colspan="3"><input type="text" name="witnessorgid"
					id="witnessorgid" value="${relationship.witnessorgid }" readonly="readonly"></td>
				<td align="right">见证人</td>
				<td><input size="10" name="witnesses" type="text"
					id="witnesses" value="${witnesses }"></td>
				<td style="width: 70px">联系电话</td>
				<td align="left"><input style="width: 110px; text-align: left"
					type="text" name="wphone" id="wphone" value="${wphone }"></td>
			</tr>
			<tr>
				<td>委托送样人</td>
				<td><input style="width: 100%" type="text" name="operations"
					id="operations" value="${ operations}"></td>
				<td style="width: 100px; text-align: right;">联系电话</td>
				<td><input style="width: 100%" type="text" name="ophone"
					size="15" id="ophone" value="${ ophone}"></td>
				<td style="width: 70px" align="right">抽检人</td>
				<td><input type="text" name="checkpeople" size="10"
					id="checkpeople" value="${ checkpeople}"></td>
				<td>联系电话</td>
				<td align="left"><input type="text" name="checkphone"
					style="width: 110px" id="checkphone" value="${checkphone }"></td>
			</tr>
		</table>
		<table>
			<tr>
				<td rowspan="2" style="width: 60px">检验项目依据标准</td>
				<td rowspan="2">
					<table>
						<tr>
							<td style="width: 50px">1.土木:</td>
							<td><input type="checkbox" name="ord" value="11"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 11 }">checked="checked"</c:if></c:forEach>>颗粒分析
							</td>
							<td><input type="checkbox" name="ord" value="12"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 12 }">checked="checked"</c:if></c:forEach>>液塑限</td>
							<td><input type="checkbox" name="ord" value="131"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 131 }">checked="checked"</c:if></c:forEach>>重型击实</td>
							<td><input type="checkbox" name="ord" value="132"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 132 }">checked="checked"</c:if></c:forEach>>轻型击实</td>
						</tr>
						<tr>
							<td></td>
							<td><input type="checkbox" name="ord" value="14"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 14 }">checked="checked"</c:if></c:forEach>>CBR(9区)</td>
							<td><input type="checkbox" name="ord" value="15"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 15 }">checked="checked"</c:if></c:forEach>>烧失量</td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td colspan="2">2.无机结合料稳定材料:</td>
							<td><input type="checkbox" name="ord" value="21"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 21 }">checked="checked"</c:if></c:forEach>>筛分(石屑、石碎)</td>
							<td><input type="checkbox" name="ord" value="22"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 22 }">checked="checked"</c:if></c:forEach>>击实(水泥)</td>
							<td><input type="checkbox" name="ord" value="23"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 23 }">checked="checked"</c:if></c:forEach>>标准曲线</td>

						</tr>
						<tr>
							<td></td>
							<td colspan="2"><input type="checkbox" name="ord" value="24"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 24 }">checked="checked"</c:if></c:forEach>>无侧限抗压强度(水泥)</td>
							<td colspan="2"><input type="checkbox" name="ord" value="25"
								<c:forEach items="${orders}" var="p"><c:if test="${p.type == 25 }">checked="checked"</c:if></c:forEach>>水泥或石灰剂量测定</td>
						</tr>
						<tr>
							<td>试验依据:</td>
							<td colspan="4">《公路土工试验规程》JTG E40-2007，JTG F10-2006</td>
						</tr>
						<tr>
							<td></td>
							<td colspan="4">《公路工程无机结合料稳定材料试验规程》JTJ 057-94，JTJ 034-2000 <input
								type="hidden" name="entrust.standard"
								value="《公路土工试验规程》JTG E40-2007，JTG F10-2006
									      《公路工程沥青及沥青混合料试验规程》JTJ052-2000，GB50092-96，JTG F40-2004">
							</td>
						</tr>
					</table>
				</td>
				<td style="width: 60px">收费金额</td>
				<td><input size="5" name="amount" type="text"
					value="${amount }" style="width: 100%"></td>
			</tr>
			<tr>
				<td>收费人签名</td>
				<td><input size="5" name="feeearner" type="text"
					value="${feeearner }" style="width: 100%"></td>
			</tr>
		</table>
		<table id="tab">
			<tr>
				<th align="center">试样名称（<input type="button" id="add"
					value="添加">）
				</th>
				<th align="center" style="width: 70px">数量</th>
				<th align="center" style="width: 70px" colspan="2">取样地点</th>
				<th align="center" style="width: 70px" colspan="2">用途</th>
			</tr>
			<c:forEach items="${oldTrialwt05s }" var="o" varStatus="sn">
				<tr id="old${sn.index }">
					<td>【<input type='button' value='删除'
						onclick="del('old${sn.index}');">】<input size="10"
						type="text" name="oldTrialwt05s[${sn.index }].name"
						class='required' value="${o.name }"></td>
					<td><input size="8" style="width: 100%" type="text"
						name="oldTrialwt05s[${sn.index }].amount" class='required'
						value="${o.amount }"></td>
					<td colspan="2"><input size="5" style="width: 100%"
						type="text" name="oldTrialwt05s[${sn.index }].address"
						class='required' value="${o.address }"></td>
					<td colspan="2"><input size="2" style="width: 100%"
						type="text" name="oldTrialwt05s[${sn.index }].source"
						value="${o.source }"></td>
				</tr>
			</c:forEach>
			<c:if test="${empty oldTrialwt05s }">
				<tr id="0">
					<td>【<input type='button' value='删除' onclick="del('0');">】<input
						size="10" type="text" name="trialwt05s[0].name" class='required'></td>
					<td><input size="8" style="width: 100%" type="text"
						name="trialwt05s[0].amount" class='required'></td>
					<td colspan="2"><input size="5" style="width: 100%"
						type="text" name="trialwt05s[0].address" class='required'></td>
					<td colspan="2"><input size="2" style="width: 100%"
						type="text" name="trialwt05s[0].source"></td>
				</tr>
				<tr id="1">
					<td>【<input type='button' value='删除' onclick="del('1');">】<input
						size="10" type="text" name="trialwt05s[1].name" class='required'></td>
					<td><input size="8" style="width: 100%" type="text"
						name="trialwt05s[1].amount" class='required'></td>
					<td colspan="2"><input size="5" style="width: 100%"
						type="text" name="trialwt05s[1].address" class='required'></td>
					<td colspan="2"><input size="2" style="width: 100%"
						type="text" name="trialwt05s[1].source"></td>
				</tr>
			</c:if>
		</table>
		<table>
			<tr>
				<td>收样人</td>
				<td><input type="text" name="acceptkindpeople"
					value="${acceptkindpeople }" class='required'></td>
				<td>预约报告日期</td>
				<td><input type="text" name="reportdate" value="${reportdate }"
					class='required' id="reportDate"></td>
			</tr>
		</table>
		<div class="type-button">
			<input type="button" id="submitbtn" class="submit" value="暂存" />&nbsp;
			<input type="button" id="save" class="submit" value="提交" />&nbsp;
			<input type="button" value="返回" class="reset"
				onclick="history.back()" />
		</div>
		</div>
	</form>
</body>
</html>